import h from './my-snabbdom/h'
import patch from './my-snabbdom/patch'
const container = document.getElementById("container");

// const myVNode = h('h2',{},'hello')
// const myVNode = h('ul',{key:'ul'},[
//   h('li',{key:'a'},'a'),
//   h('li',{key:'b'},'b'),
//   h('li',{key:'c'},'c'),
//   h('li',{key:'d'},'d'),
// ])
// patch(container,myVNode);

// const vnode2 = h('ul',{key:'ul'},[
//   h('li',{key:'e'},'e'),
//   h('li',{key:'g'},'g'),
//   h('li',{key:'a'},'a'),
//   h('li',{key:'b'},'b'),
//   h('li',{key:'c'},'c'),
//   h('li',{key:'d'},'d'),
  
// ])

const myVNode = h('ul',{key:'ul'},[
  h('li',{key:'a'},'a'),
  h('li',{key:'b'},'b'),
  h('li',{key:'c'},'c'),
  h('li',{key:'d'},'d'),
  h('li',{key:'e'},'e'),
])
patch(container,myVNode);

const vnode2 = h('ul',{key:'ul'},[
  h('li',{key:'a'},'a'),
  h('li',{key:'b'},'b'),
  h('li',{key:'d'},'d'),
  
])

document.querySelector('button').onclick=function(e){
  patch(myVNode,vnode2)
}
// console.log('myVNode: ', myVNode);